package kr.hkit.androidcomplete01.ch11;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

public class ShowHideKey extends Activity {
	private InputMethodManager mImm;
	private EditText mEdit;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch11_showhidekey);
		
		mImm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
		mEdit = (EditText) findViewById(R.id.edit);
	}
	
	public void mOnClick(View v){
		switch(v.getId()){
		case R.id.show:
			mImm.showSoftInput(mEdit, 0);
			break;
		case R.id.hide:
			mImm.hideSoftInputFromWindow(mEdit.getWindowToken(), 0);
			break;
		}
	}
}
